package ExerciseClass;

public class ExerciseImplTest {


    public static void main(String[] args) {
          ExerciseInterface<Integer>test = new ExerciseImpl(new Integer[3]);
          boolean empty = test.isEmpty();
          System.out.println(empty);
          test.toString();
          System.out.println("添加元素前");
//        添加数据
          System.out.println("添加元素后");
          test.add(1);
          test.add(2);
          test.add(3);
          //扩容数组
          test.add(4);
          test.add(5);
          test.toString();
          System.out.println("长度为:"+test.size());
          boolean empty1 = test.isEmpty();
          System.out.println(empty1);
          //遍历数组
          test.toString();
          System.out.println("清空之前");
          test.clear();
          System.out.println("清空之后");
//          遍历数组
          test.toString();
//          测试清空之后能否添加数据
          test.add(1);
          test.add(2);
          test.add(3);
          test.add(4);
          test.add(5);
          test.toString();
          //删除元素之后
          test.remove(1);
          test.toString();
          System.out.println("长度为:"+test.size());
          //遍历数组
          test.toString();
          test.contains(2);
          Integer search = test.search(2);
          System.out.println(search);
    }
}